moveAnnex :: Key -> AssociatedFile -> RawFilePath -> Annex Bool
moveAnnex key af src = ifM (checkSecureHashes' key)
( do
+#ifdef mingw32_HOST_OS
+ {- Windows prevents deletion of files that are not
+ - writable, and the file could have such a mode.
+ - So avoid problems with deleting the file, now or later. -}
+ void $ liftIO $ tryIO $ allowWrite src
+#endif
withObjectLoc key storeobject
return True
, return False
-}
whenM hasThawHook $
void $ tryIO $ thawContent file
-
+#ifdef mingw32_HOST_OS
+ {- Windows prevents deletion of files that are not writable. -}
+ void $ liftIO $ tryIO $ allowWrite file
+#endif
+
cleaner
cleanObjectDirs file
* Allow enableremote of an existing webdav special remote that has
read-only access.
* git-remote-annex: Use enableremote rather than initremote.
+ * Windows: Fix permission denied error when dropping files that
+ have the readonly attribute set.
-- Joey Hess <id@joeyh.name> Fri, 03 Jan 2025 14:30:38 -0400
[[!tag projects/datalad]]
[[!tag projects/INM7]]
+
+> I think this is [[fixed|done]] now.. --[[Joey]]
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 4"""
+ date="2025-01-07T20:33:22Z"
+ content="""
+I see that the directory special remote, on windows, adds back the write
+permission on files before removing them. That was done way back in
+[[!commit 38022f4f493588505896635703c34afa6c2e2406]].
+
+I've applied the same fix now to the annex objects side, so this should be
+fixed.
+"""]]
[[!meta author=jkniiv]]
[[!tag projects/INM7]]
+
+> I think this is [[fixed|done]] --[[Joey]]
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 5"""
+ date="2025-01-07T20:31:07Z"
+ content="""
+I see that the directory special remote, on windows, adds back the write
+permission on files before removing them. That was done way back in
+[[!commit 38022f4f493588505896635703c34afa6c2e2406]].
+
+I've applied the same fix now to the annex objects side, so this should be
+fixed.
+"""]]